import log from '@/log4js'
import moment from 'moment-mini'

class InitMiddleware{
  private app
  constructor(app){
    this.app = app
    this.register()
  }
  register(){
    this.app.use(async (ctx,next) => {
      ctx.moment = moment
      ctx.log = log
      ctx.session.user = '张三'
      await next()
    })
  }
}

export default InitMiddleware
